<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:af="http://myfaces.apache.org/trinidad"
	xmlns:afh="http://myfaces.apache.org/trinidad/html"
	>

	<afh:tableLayout>
		<afh:rowLayout>
			<afh:cellFormat styleClass="columnHeader_textColumn">
                <af:panelGroupLayout layout="vertical">
                    <af:group rendered="#{filterEnabled}">
						<ui:include src="filter-field.xhtml">
							<ui:param name="fieldType" value="#{columnFieldType}" />
							<ui:param name="opDefault" value="#{columnFilterOpDefault}" />

							<ui:param name="fieldModel" value="#{columnFieldModel}" />
							<ui:param name="fieldId" value="#{columnFieldId}" />
						</ui:include>
					</af:group>
                    <af:spacer height="2px" rendered="#{filterEnabled}"/>
					<af:outputText value="#{columnHeading}" styleClass="af|column::header-text"
                        shortDesc="#{columnTooltip}">
                        <c:if test="#{not empty columnHeadingConverter}">
                            <f:converter converterId="#{columnHeadingConverter}"/>
                        </c:if>
                    </af:outputText>
                    <af:group rendered="#{not filterEnabled}">
                        <!-- Ensure that we have two elements in the panel group
                             because of the horizontal alignment of filter fields.
                        -->
                        <span style="visibility:hidden">0</span>
                    </af:group>
                </af:panelGroupLayout>
			</afh:cellFormat>

			<afh:cellFormat valign="top" styleClass="columnHeader_sortColumn">
                <af:panelGroupLayout layout="vertical">
					<af:commandLink
						text="#{'ascending' == sortModel.sortStatus[sortProperty] ? commonMsg.arrowUpFilled : commonMsg.arrowUp}"
						shortDesc="#{commonMsg.sortedAscending}"
						actionListener="#{sortModel.setSortColumn}"
						rendered="#{sortEnabled and not empty sortModel}"
						styleClass="af|column::header-text columnHeader_sortButton">
						<af:setActionListener from="#{sortProperty}" to="#{processScope.sortProperty}" />
						<af:setActionListener from="ascending" to="#{processScope.sortOrder}" />
					</af:commandLink>
					<af:commandLink
						text="#{'descending' == sortModel.sortStatus[sortProperty] ? commonMsg.arrowDownFilled : commonMsg.arrowDown}"
						shortDesc="#{commonMsg.sortedDescending}"
						actionListener="#{sortModel.setSortColumn}"
						rendered="#{sortEnabled and not empty sortModel}"
						styleClass="af|column::header-text columnHeader_sortButton">
						<af:setActionListener from="#{sortProperty}" to="#{processScope.sortProperty}" />
						<af:setActionListener from="descending" to="#{processScope.sortOrder}" />
					</af:commandLink>
                 </af:panelGroupLayout>
			</afh:cellFormat>

		</afh:rowLayout>
	</afh:tableLayout>

</ui:composition>